﻿<%@ Page Title="View Reports" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="ViewReports.aspx.cs" Inherits="TestJQGrid.ViewReports" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <table border="1px" style="width:100%;">
        <tr>
            <td rowspan="3" align="left" valign="top" style="width:20%;">
                <asp:ListBox ID="LBReportList" runat="server" DataSourceID="DSReportList" 
                    DataTextField="ReportName" DataValueField="ReportId" 
                    ondatabound="LBReportList_DataBound" 
                    onselectedindexchanged="LBReportList_SelectedIndexChanged" Rows="25" 
                    Width="100%" AutoPostBack="True"></asp:ListBox>
                <asp:SqlDataSource ID="DSReportList" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:AgentBillingConnectionString %>" 
                    SelectCommand="SELECT [ReportId], [ReportName] FROM [Reports] WHERE ([ProductName] = @ProductName)">
                    <SelectParameters>
                        <asp:SessionParameter DefaultValue="CarSales" Name="ProductName" 
                            SessionField="ProductName" Type="String" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </td>
            <td align="left" valign="top" style="height:30%;" />
        </tr>
        <tr>
            <td align="left" valign="top" style="height:60%;">
                <asp:GridView ID="GVReport" runat="server" CellPadding="4" ForeColor="#333333" >
                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                    <EditRowStyle BackColor="#999999" />
                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    <SortedAscendingCellStyle BackColor="#E9E7E2" />
                    <SortedAscendingHeaderStyle BackColor="#506C8C" />
                    <SortedDescendingCellStyle BackColor="#FFFDF8" />
                    <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                </asp:GridView>
            </td>
        </tr>
        <tr>
            <td align="center" valign="middle" style="height:10%;">
                <asp:Label ID="Label1" runat="server" Enabled="False" Text="Download As" 
                    Width="100px"></asp:Label>
                <asp:DropDownList ID="DDLDownloadType" runat="server" >
                    <asp:ListItem Selected="True" Value="0">Excel</asp:ListItem>
                    <asp:ListItem Value="1">CSV (,)</asp:ListItem>
                    <asp:ListItem Value="2">CSV (|)</asp:ListItem>
                    <asp:ListItem Value="3">PDF</asp:ListItem>
                    <asp:ListItem Value="4">MS WORD</asp:ListItem>
                </asp:DropDownList>
&nbsp;
                <asp:Button ID="BDownload" runat="server" Text="Download" 
                    onclick="BDownload_Click" />
            </td>
        </tr>
    </table>
</asp:Content>
